#pragma once

class Buffer
{
public:
	Buffer(int alloc_size);
	~Buffer();

	int getSize();
	int getReadPos() { return m_read_pos; }
	void setReadPos(int pos) { m_read_pos = pos; }

	void putInt(int v);
	void putShort(short v);

	int getInt();
	short getShort();

	int getInt(int pos);
	short getShort(int pos);

	void putRaw(const void* data, int len);

	void getRaw(void* out, int len);

	void getRaw(int pos, void* out, int len);

private:
	Buffer(){}


private:
	char* m_buf;
	int m_write_pos;
	int m_read_pos;
	int m_size;
};